import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import LegalChat from '@/views/LegalChat.vue'
import LawSearch from '@/views/LawSearch.vue'
import Welcome from '@/views/Welcome.vue'

const routes = [
  {
    path: '/',
    component: HomeView,
    children: [
      {
        path: '',        // 默认子路由
        name: 'Welcome',
        component: Welcome
      },
      {
        path: 'chat',
        name: 'LegalChat',
        component: LegalChat
      },
      {
        path: 'law',
        name: 'LawSearch',
        component: LawSearch
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
